package com.ysh.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 *
 * @TableName crimes
 */
@TableName(value ="crimes")
@Data
@AllArgsConstructor
@NoArgsConstructor
public class Crimes implements Serializable {
    /**
     * 事件编码
     */
    @TableId(value = "incident_id", type = IdType.AUTO)
    private Integer incident_id;

    /**
     * 犯罪代号
     */
    @TableField(value = "offence_code")
    private Integer offence_code;

    /**
     * 派单时间
     */
    @TableField(value = "dispatch_time")
    private Date dispatch_time;

    /**
     * 受害人数
     */
    @TableField(value = "victims")
    private Integer victims;

    /**
     * 城市
     */
    @TableField(value = "city")
    private String city;

    /**
     * 发生时间
     */
    @TableField(value = "start_date_time")
    private Date start_date_time;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        Crimes other = (Crimes) that;
        return (this.getIncident_id() == null ? other.getIncident_id() == null : this.getIncident_id().equals(other.getIncident_id()))
            && (this.getOffence_code() == null ? other.getOffence_code() == null : this.getOffence_code().equals(other.getOffence_code()))
            && (this.getDispatch_time() == null ? other.getDispatch_time() == null : this.getDispatch_time().equals(other.getDispatch_time()))
            && (this.getVictims() == null ? other.getVictims() == null : this.getVictims().equals(other.getVictims()))
            && (this.getCity() == null ? other.getCity() == null : this.getCity().equals(other.getCity()))
            && (this.getStart_date_time() == null ? other.getStart_date_time() == null : this.getStart_date_time().equals(other.getStart_date_time()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getIncident_id() == null) ? 0 : getIncident_id().hashCode());
        result = prime * result + ((getOffence_code() == null) ? 0 : getOffence_code().hashCode());
        result = prime * result + ((getDispatch_time() == null) ? 0 : getDispatch_time().hashCode());
        result = prime * result + ((getVictims() == null) ? 0 : getVictims().hashCode());
        result = prime * result + ((getCity() == null) ? 0 : getCity().hashCode());
        result = prime * result + ((getStart_date_time() == null) ? 0 : getStart_date_time().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", incident_id=").append(incident_id);
        sb.append(", offence_code=").append(offence_code);
        sb.append(", dispatch_time=").append(dispatch_time);
        sb.append(", victims=").append(victims);
        sb.append(", city=").append(city);
        sb.append(", start_date_time=").append(start_date_time);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}
